# -*- coding: utf-8 -*-
from django.http import Http404
from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.core.paginator import ObjectPaginator, InvalidPage
from vts.firmy.models import Firma, NumerTelefonu, Email
from django.contrib.auth.decorators import login_required

@login_required 
def firmy(request):
    request.session['prev']=request.path
    list = {}
    list['firma'] = Firma.objects.all().order_by(request.GET['ot']+request.GET['of'])
    list['numer_telefonu'] = NumerTelefonu.objects.all()
    list['email'] = Email.objects.all()
    return render_to_response('firmy/firmy.html', {'list':list, 'session':request.session, 'get':request.GET })
